package com.example.BlockChain.service.impl;

import com.example.BlockChain.dao.TimingDao;
import com.example.BlockChain.entity.Timing;
import com.example.BlockChain.service.TimingService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class TimingServiceImpl implements TimingService {

    @Resource
    TimingDao timingDao;

    @Override
    public void updateAcceptTime(Timing timing) {
        timingDao.updateAcceptTime(timing);
    }

    @Override
    public void setNewTiming(Timing newtiming) {
        timingDao.saveOrderId(newtiming);
    }

    @Override
    public String selectTiming(String orderid) {
        return timingDao.selectTiming(orderid);
    }

    @Override
    public String selectTiming2(String orderId) {
        // 调用 DAO 方法获取接单时间
        return timingDao.selectAcceptTime2(orderId);
    }
}
